//引入增强js
import '@/util/extends/toFirstUpperCase';

//所有的view页面功能显示点
//这叫菜单功能树
const viewTree = [{
    name:"主框架",
    flag:"main",
    children:[
        {
            name:"首页",
            flag:"home",
            children:[],
        },
        {
            name:"用户管理",
            flag:"user",
            children:[
                {
                    name:"配置管理部门按钮权限",
                    flag:"managementdepartmentBtn",
                    children:[],
                },
                {
                    name:"配置管理部门按钮权限",
                    flag:"managementmarketBtn",
                    children:[],
                }
                
            ],
        },
        
        {
            name:"部门管理",
            flag:"department",
            children:[],
        },
        
        {
            name:"职位管理",
            flag:"position",
            children:[],
        },
        
        {
            name:"商场管理",
            flag:"agent",
            children:[
                {
                    name:"配置商场品牌品类编辑权限",
                    flag:"editbrandcategort",
                    children:[],
                },{
                    name: "控制商场基本信息是否可编辑",
                    flag: "baseInfoEdit"
                }
            ],
        },
        
        {
            name:"角色管理",
            flag:"role",
            children:[],
        },
        
        {
            name:"权限管理",
            flag:"access",
            children:[],
        },
        
        {
            name:"系统日志",
            flag:"systemLog",
            children:[],
        },

        {
            name:"字典管理",
            flag:"dict",
            children:[],
        },

    ]
}];
let list = [];
let apiViewMerge = function (arr = [],prefix = 'view'){
    arr.forEach(v=>{
        let name = prefix + v.flag.toFirstUpperCase();
        // //console.log(name, "name")
        list.push(name)
        apiViewMerge(v.children, name)
    })
}
apiViewMerge(viewTree);
export default viewTree;
export const viewNameList = list;